home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS Toolkit
/
BBS Toolkit.iso
/
doors_1
/
doorskl3.zip
/
XBBSMSG.ZIP
/
STRIPS.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-02-15
|
834b
|
51 lines
#include <string.h>
#include <ctype.h>
char * _fastcall rstrip (char *a) { /* Remove trailing spaces and tabs */
register int x;
x=strlen(a);
while (x && a && (a[x-1]==' ' || a[x-1]=='\t')) a[--x]=0;
return a;
}
char * _fastcall lstrip (char *a) { /* Remove leading spaces and tabs */
register int x;
x=strlen(a);
while (x && (*a==' ' || *a=='\t')) memmove (a,(a+1),x--);
return (a);
}
char * _fastcall stripcr (char *a) { /* Remove trailing crs and lfs */
register int x;
x=strlen(a);
while (x && (a[x-1]=='\n' || a[x-1]=='\r')) a[--x]=0;
return a;
}
char * _fastcall strip_trail_bksl (char *a) { /* Remove trailing slashes */
register int x;
x=strlen(a);
while (x && (a[x-1]=='/' || a[x-1]=='\\')) a[--x]=0;
return a;
}